package com.zeh.bill.controller;


import com.zeh.bill.service.FileService;
import com.zeh.bill.untils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/api/oss/file")
public class OSSController {
    @Autowired
    private FileService fileService;

    @PostMapping("/upload")
    public Result upload(MultipartFile file, String module){
        //返回上传到oss的路径
      String url =  fileService.upload(file,module);
      return Result.ok(url).message("文件上传成功");
    }

}
